package com.sfx.distributedb.dao;

import com.sfx.distributedb.dto.OrderDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderMapper {

    @Insert("insert into t_order (order_id, order_name) values (#{order_id}, #{order_name})")
    void insertOrder(@Param("order_id") Integer order_id, @Param("order_name") String order_name);

    @Insert("insert into t_order (order_id, user_id,order_name) values (#{order_id}, #{user_id},#{order_name})")
    void insertOrderByUserIdAndOrderId(@Param("user_id") Integer user_id,@Param("order_id") Integer order_id, @Param("order_name") String order_name);

    @Select("select * from t_order where order_id = #{order_id}")
    OrderDO selectOrder(int order_id);
}